<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class Gem::Request - rubygems: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link">Object
</div>

        
<div id="includes-section" class="nav-section">
  <h3>Included Modules</h3>

  <ul class="link-list">
    <li><a class="include" href="UserInteraction.html">Gem::UserInteraction</a>
  </ul>
</div>

        
<div id="extends-section" class="nav-section">
  <h3>Extended With Modules</h3>

  <ul class="link-list">
    <li><a class="extend" href="UserInteraction.html">Gem::UserInteraction</a>
  </ul>
</div>

        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-configure_connection_for_https">::configure_connection_for_https</a>
    <li ><a href="#method-c-get_cert_files">::get_cert_files</a>
    <li ><a href="#method-c-get_proxy_from_env">::get_proxy_from_env</a>
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-c-verify_certificate">::verify_certificate</a>
    <li ><a href="#method-c-verify_certificate_message">::verify_certificate_message</a>
    <li ><a href="#method-i-cert_files">#cert_files</a>
    <li ><a href="#method-i-connection_for">#connection_for</a>
    <li ><a href="#method-i-fetch">#fetch</a>
    <li ><a href="#method-i-proxy_uri">#proxy_uri</a>
    <li ><a href="#method-i-reset">#reset</a>
    <li ><a href="#method-i-user_agent">#user_agent</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-Gem::Request">
    <h1 id="class-Gem::Request" class="class">
      class Gem::Request
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">





                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-configure_connection_for_https" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">configure_connection_for_https</span><span
                                class="method-args">(connection, cert_files)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="configure_connection_for_https-source">
            <pre><span class="ruby-comment"># File rubygems/request.rb, line 52</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">configure_connection_for_https</span>(<span class="ruby-identifier">connection</span>, <span class="ruby-identifier">cert_files</span>)
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Exception</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;OpenSSL is not available. Install OpenSSL and rebuild Ruby (preferred) or use non-HTTPS sources&quot;</span>) <span class="ruby-keyword">unless</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">HAVE_OPENSSL</span>

  <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">use_ssl</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">verify_mode</span> =
    <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">ssl_verify_mode</span> <span class="ruby-operator">||</span> <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">SSL</span><span class="ruby-operator">::</span><span class="ruby-constant">VERIFY_PEER</span>
  <span class="ruby-identifier">store</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">X509</span><span class="ruby-operator">::</span><span class="ruby-constant">Store</span>.<span class="ruby-identifier">new</span>

  <span class="ruby-keyword">if</span> <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">ssl_client_cert</span>
    <span class="ruby-identifier">pem</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span> <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">ssl_client_cert</span>
    <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">cert</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">X509</span><span class="ruby-operator">::</span><span class="ruby-constant">Certificate</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">pem</span>
    <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">key</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">PKey</span><span class="ruby-operator">::</span><span class="ruby-constant">RSA</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">pem</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">store</span>.<span class="ruby-identifier">set_default_paths</span>
  <span class="ruby-identifier">cert_files</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ssl_cert_file</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">store</span>.<span class="ruby-identifier">add_file</span> <span class="ruby-identifier">ssl_cert_file</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">ssl_ca_cert</span>
    <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span> <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">ssl_ca_cert</span>
      <span class="ruby-identifier">store</span>.<span class="ruby-identifier">add_path</span> <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">ssl_ca_cert</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">store</span>.<span class="ruby-identifier">add_file</span> <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">ssl_ca_cert</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">cert_store</span> = <span class="ruby-identifier">store</span>

  <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">verify_callback</span> = <span class="ruby-identifier">proc</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">preverify_ok</span>, <span class="ruby-identifier">store_context</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">verify_certificate</span> <span class="ruby-identifier">store_context</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">preverify_ok</span>

    <span class="ruby-identifier">preverify_ok</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">connection</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-get_cert_files" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">get_cert_files</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="get_cert_files-source">
            <pre><span class="ruby-comment"># File rubygems/request.rb, line 47</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">get_cert_files</span>
  <span class="ruby-identifier">pattern</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-string">&quot;./ssl_certs/*/*.pem&quot;</span>, <span class="ruby-identifier">__dir__</span>)
  <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>(<span class="ruby-identifier">pattern</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-get_proxy_from_env" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">get_proxy_from_env</span><span
                                class="method-args">(scheme = &quot;http&quot;)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns a proxy URI for the given <code>scheme</code> if one is set in the environment variables.</p>

                              <div class="method-source-code" id="get_proxy_from_env-source">
            <pre><span class="ruby-comment"># File rubygems/request.rb, line 167</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">get_proxy_from_env</span>(<span class="ruby-identifier">scheme</span> = <span class="ruby-string">&quot;http&quot;</span>)
  <span class="ruby-identifier">downcase_scheme</span> = <span class="ruby-identifier">scheme</span>.<span class="ruby-identifier">downcase</span>
  <span class="ruby-identifier">upcase_scheme</span> = <span class="ruby-identifier">scheme</span>.<span class="ruby-identifier">upcase</span>
  <span class="ruby-identifier">env_proxy</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-node">&quot;#{downcase_scheme}_proxy&quot;</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">ENV</span>[<span class="ruby-node">&quot;#{upcase_scheme}_PROXY&quot;</span>]

  <span class="ruby-identifier">no_env_proxy</span> = <span class="ruby-identifier">env_proxy</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">env_proxy</span>.<span class="ruby-identifier">empty?</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">no_env_proxy</span>
    <span class="ruby-keyword">return</span> [<span class="ruby-string">&quot;https&quot;</span>, <span class="ruby-string">&quot;http&quot;</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">downcase_scheme</span>) <span class="ruby-operator">?</span> <span class="ruby-value">:no_proxy</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">get_proxy_from_env</span>(<span class="ruby-string">&quot;http&quot;</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">require</span> <span class="ruby-string">&quot;uri&quot;</span>
  <span class="ruby-identifier">uri</span> = <span class="ruby-constant">URI</span>(<span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">UriFormatter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">env_proxy</span>).<span class="ruby-identifier">normalize</span>)

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">uri</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">user</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">password</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-identifier">user</span>     = <span class="ruby-constant">ENV</span>[<span class="ruby-node">&quot;#{downcase_scheme}_proxy_user&quot;</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">ENV</span>[<span class="ruby-node">&quot;#{upcase_scheme}_PROXY_USER&quot;</span>]
    <span class="ruby-identifier">password</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-node">&quot;#{downcase_scheme}_proxy_pass&quot;</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">ENV</span>[<span class="ruby-node">&quot;#{upcase_scheme}_PROXY_PASS&quot;</span>]

    <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">user</span>     = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">UriFormatter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">user</span>).<span class="ruby-identifier">escape</span>
    <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">password</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">UriFormatter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">password</span>).<span class="ruby-identifier">escape</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">uri</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">(uri, request_class, last_modified, pool)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File rubygems/request.rb, line 29</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">request_class</span>, <span class="ruby-identifier">last_modified</span>, <span class="ruby-identifier">pool</span>)
  <span class="ruby-ivar">@uri</span> = <span class="ruby-identifier">uri</span>
  <span class="ruby-ivar">@request_class</span> = <span class="ruby-identifier">request_class</span>
  <span class="ruby-ivar">@last_modified</span> = <span class="ruby-identifier">last_modified</span>
  <span class="ruby-ivar">@requests</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> <span class="ruby-value">0</span>
  <span class="ruby-ivar">@user_agent</span> = <span class="ruby-identifier">user_agent</span>

  <span class="ruby-ivar">@connection_pool</span> = <span class="ruby-identifier">pool</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-verify_certificate" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">verify_certificate</span><span
                                class="method-args">(store_context)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="verify_certificate-source">
            <pre><span class="ruby-comment"># File rubygems/request.rb, line 88</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">verify_certificate</span>(<span class="ruby-identifier">store_context</span>)
  <span class="ruby-identifier">depth</span>  = <span class="ruby-identifier">store_context</span>.<span class="ruby-identifier">error_depth</span>
  <span class="ruby-identifier">error</span>  = <span class="ruby-identifier">store_context</span>.<span class="ruby-identifier">error_string</span>
  <span class="ruby-identifier">number</span> = <span class="ruby-identifier">store_context</span>.<span class="ruby-identifier">error</span>
  <span class="ruby-identifier">cert</span>   = <span class="ruby-identifier">store_context</span>.<span class="ruby-identifier">current_cert</span>

  <span class="ruby-identifier">ui</span>.<span class="ruby-identifier">alert_error</span> <span class="ruby-node">&quot;SSL verification error at depth #{depth}: #{error} (#{number})&quot;</span>

  <span class="ruby-identifier">extra_message</span> = <span class="ruby-identifier">verify_certificate_message</span> <span class="ruby-identifier">number</span>, <span class="ruby-identifier">cert</span>

  <span class="ruby-identifier">ui</span>.<span class="ruby-identifier">alert_error</span> <span class="ruby-identifier">extra_message</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">extra_message</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-verify_certificate_message" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">verify_certificate_message</span><span
                                class="method-args">(error_number, cert)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="verify_certificate_message-source">
            <pre><span class="ruby-comment"># File rubygems/request.rb, line 101</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">verify_certificate_message</span>(<span class="ruby-identifier">error_number</span>, <span class="ruby-identifier">cert</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">cert</span>
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">error_number</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">X509</span><span class="ruby-operator">::</span><span class="ruby-constant">V_ERR_CERT_HAS_EXPIRED</span> <span class="ruby-keyword">then</span>
    <span class="ruby-identifier">require</span> <span class="ruby-string">&quot;time&quot;</span>
    <span class="ruby-node">&quot;Certificate #{cert.subject} expired at #{cert.not_after.iso8601}&quot;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">X509</span><span class="ruby-operator">::</span><span class="ruby-constant">V_ERR_CERT_NOT_YET_VALID</span> <span class="ruby-keyword">then</span>
    <span class="ruby-identifier">require</span> <span class="ruby-string">&quot;time&quot;</span>
    <span class="ruby-node">&quot;Certificate #{cert.subject} not valid until #{cert.not_before.iso8601}&quot;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">X509</span><span class="ruby-operator">::</span><span class="ruby-constant">V_ERR_CERT_REJECTED</span> <span class="ruby-keyword">then</span>
    <span class="ruby-node">&quot;Certificate #{cert.subject} is rejected&quot;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">X509</span><span class="ruby-operator">::</span><span class="ruby-constant">V_ERR_CERT_UNTRUSTED</span> <span class="ruby-keyword">then</span>
    <span class="ruby-node">&quot;Certificate #{cert.subject} is not trusted&quot;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">X509</span><span class="ruby-operator">::</span><span class="ruby-constant">V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT</span> <span class="ruby-keyword">then</span>
    <span class="ruby-node">&quot;Certificate #{cert.issuer} is not trusted&quot;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">X509</span><span class="ruby-operator">::</span><span class="ruby-constant">V_ERR_INVALID_CA</span> <span class="ruby-keyword">then</span>
    <span class="ruby-node">&quot;Certificate #{cert.subject} is an invalid CA certificate&quot;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">X509</span><span class="ruby-operator">::</span><span class="ruby-constant">V_ERR_INVALID_PURPOSE</span> <span class="ruby-keyword">then</span>
    <span class="ruby-node">&quot;Certificate #{cert.subject} has an invalid purpose&quot;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">X509</span><span class="ruby-operator">::</span><span class="ruby-constant">V_ERR_SELF_SIGNED_CERT_IN_CHAIN</span> <span class="ruby-keyword">then</span>
    <span class="ruby-node">&quot;Root certificate is not trusted (#{cert.subject})&quot;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">X509</span><span class="ruby-operator">::</span><span class="ruby-constant">V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY</span> <span class="ruby-keyword">then</span>
    <span class="ruby-node">&quot;You must add #{cert.issuer} to your local trusted store&quot;</span>
  <span class="ruby-keyword">when</span>
    <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">X509</span><span class="ruby-operator">::</span><span class="ruby-constant">V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE</span> <span class="ruby-keyword">then</span>
    <span class="ruby-node">&quot;Cannot verify certificate issued by #{cert.issuer}&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-cert_files" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">cert_files</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="cert_files-source">
            <pre><span class="ruby-comment"># File rubygems/request.rb, line 43</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cert_files</span>
  <span class="ruby-ivar">@connection_pool</span>.<span class="ruby-identifier">cert_files</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-connection_for" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">connection_for</span><span
                                class="method-args">(uri)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Creates or an HTTP connection based on <code>uri</code>, or retrieves an existing connection, using a proxy if needed.</p>

                              <div class="method-source-code" id="connection_for-source">
            <pre><span class="ruby-comment"># File rubygems/request.rb, line 134</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">connection_for</span>(<span class="ruby-identifier">uri</span>)
  <span class="ruby-ivar">@connection_pool</span>.<span class="ruby-identifier">checkout</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">HAVE_OPENSSL</span> <span class="ruby-operator">?</span> <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">SSL</span><span class="ruby-operator">::</span><span class="ruby-constant">SSLError</span> <span class="ruby-operator">:</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EHOSTDOWN</span>,
       <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EHOSTDOWN</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">RemoteFetcher</span><span class="ruby-operator">::</span><span class="ruby-constant">FetchError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>, <span class="ruby-identifier">uri</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-fetch" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">fetch</span><span
                                class="method-args">() { |request| ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="fetch-source">
            <pre><span class="ruby-comment"># File rubygems/request.rb, line 141</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">fetch</span>
  <span class="ruby-identifier">request</span> = <span class="ruby-ivar">@request_class</span>.<span class="ruby-identifier">new</span> <span class="ruby-ivar">@uri</span>.<span class="ruby-identifier">request_uri</span>

  <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@uri</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@uri</span>.<span class="ruby-identifier">user</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@uri</span>.<span class="ruby-identifier">user</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-identifier">request</span>.<span class="ruby-identifier">basic_auth</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">UriFormatter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@uri</span>.<span class="ruby-identifier">user</span>).<span class="ruby-identifier">unescape</span>,
                       <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">UriFormatter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@uri</span>.<span class="ruby-identifier">password</span>).<span class="ruby-identifier">unescape</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">request</span>.<span class="ruby-identifier">add_field</span> <span class="ruby-string">&quot;User-Agent&quot;</span>, <span class="ruby-ivar">@user_agent</span>
  <span class="ruby-identifier">request</span>.<span class="ruby-identifier">add_field</span> <span class="ruby-string">&quot;Connection&quot;</span>, <span class="ruby-string">&quot;keep-alive&quot;</span>
  <span class="ruby-identifier">request</span>.<span class="ruby-identifier">add_field</span> <span class="ruby-string">&quot;Keep-Alive&quot;</span>, <span class="ruby-string">&quot;30&quot;</span>

  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@last_modified</span>
    <span class="ruby-identifier">require</span> <span class="ruby-string">&quot;time&quot;</span>
    <span class="ruby-identifier">request</span>.<span class="ruby-identifier">add_field</span> <span class="ruby-string">&quot;If-Modified-Since&quot;</span>, <span class="ruby-ivar">@last_modified</span>.<span class="ruby-identifier">httpdate</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">yield</span> <span class="ruby-identifier">request</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>

  <span class="ruby-identifier">perform_request</span> <span class="ruby-identifier">request</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-proxy_uri" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">proxy_uri</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="proxy_uri-source">
            <pre><span class="ruby-comment"># File rubygems/request.rb, line 39</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">proxy_uri</span>
  <span class="ruby-ivar">@connection_pool</span>.<span class="ruby-identifier">proxy_uri</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-reset" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">reset</span><span
                                class="method-args">(connection)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Resets HTTP connection <code>connection</code>.</p>

                              <div class="method-source-code" id="reset-source">
            <pre><span class="ruby-comment"># File rubygems/request.rb, line 269</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">reset</span>(<span class="ruby-identifier">connection</span>)
  <span class="ruby-ivar">@requests</span>.<span class="ruby-identifier">delete</span> <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">object_id</span>

  <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">finish</span>
  <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">start</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-user_agent" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">user_agent</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="user_agent-source">
            <pre><span class="ruby-comment"># File rubygems/request.rb, line 276</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">user_agent</span>
  <span class="ruby-identifier">ua</span> = <span class="ruby-node">&quot;RubyGems/#{Gem::VERSION} #{Gem::Platform.local}&quot;</span>.<span class="ruby-identifier">dup</span>

  <span class="ruby-identifier">ruby_version</span> = <span class="ruby-constant">RUBY_VERSION</span>
  <span class="ruby-identifier">ruby_version</span> <span class="ruby-operator">+=</span> <span class="ruby-string">&quot;dev&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">RUBY_PATCHLEVEL</span> <span class="ruby-operator">==</span> <span class="ruby-value">-1</span>

  <span class="ruby-identifier">ua</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; Ruby/#{ruby_version} (#{RUBY_RELEASE_DATE}&quot;</span>
  <span class="ruby-keyword">if</span> <span class="ruby-constant">RUBY_PATCHLEVEL</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-value">0</span>
    <span class="ruby-identifier">ua</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; patchlevel #{RUBY_PATCHLEVEL}&quot;</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">ua</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; revision #{RUBY_REVISION}&quot;</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">ua</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;)&quot;</span>

  <span class="ruby-identifier">ua</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; #{RUBY_ENGINE}&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">RUBY_ENGINE</span> <span class="ruby-operator">!=</span> <span class="ruby-string">&quot;ruby&quot;</span>

  <span class="ruby-identifier">ua</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is a service of <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>, purveyors of fine <a href='https://jamesbritt.bandcamp.com/'>dance noise</a></p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

